/**
 * 
 */
package cn.softTank.BpelModelImpl;

import java.util.List;

import org.dom4j.Element;

import cn.softTank.BpelModel.Catch;
import cn.softTank.BpelModel.CatchAll;
import cn.softTank.BpelModel.CompensationHandler;
import cn.softTank.BpelModel.FromParts;
import cn.softTank.BpelModel.Invoke;
import cn.softTank.BpelModel.ToParts;
import cn.softTank.BpelModel.Variable;

/**
 * @author Yuzone (smartzxy@gmail.com)
 * 
 */
public class InvokeImpl extends PartnerActivityImpl implements Invoke {

//	private List<Catch> catches;
//	private CatchAll catchAll;
//	private CompensationHandler compensationHandler;
	private FromParts fromParts;
	private ToParts toParts;
	private Variable inputVariable;
	private Variable outputVariable;

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#addCatch(cn.softTank.BpelModel.Catch)
	 */
	@Override
	public void addCatch(Catch value) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#getCatch()
	 */
	@Override
	public List<Catch> getCatch() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#getCatchAll()
	 */
	@Override
	public CatchAll getCatchAll() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#getCompensationHandler()
	 */
	@Override
	public CompensationHandler getCompensationHandler() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#getFromParts()
	 */
	@Override
	public FromParts getFromParts() {
		return fromParts;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#getInputVariable()
	 */
	@Override
	public Variable getInputVariable() {
		return inputVariable;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#getOutputVariable()
	 */
	@Override
	public Variable getOutputVariable() {
		return outputVariable;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#getToParts()
	 */
	@Override
	public ToParts getToParts() {
		return toParts;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#removeCatchAt(int)
	 */
	@Override
	public void removeCatchAt(int index) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.softTank.BpelModel.Invoke#setCatch(java.util.List)
	 */
	@Override
	public void setCatch(List<Catch> value) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.softTank.BpelModel.Invoke#setCatchAll(cn.softTank.BpelModel.CatchAll)
	 */
	@Override
	public void setCatchAll(CatchAll value) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.softTank.BpelModel.Invoke#setCompensationHandler(cn.softTank.BpelModel
	 * .CompensationHandler)
	 */
	@Override
	public void setCompensationHandler(CompensationHandler value) {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.softTank.BpelModel.Invoke#setFromParts(cn.softTank.BpelModel.FromParts
	 * )
	 */
	@Override
	public void setFromParts(FromParts value) {
		fromParts = value;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.softTank.BpelModel.Invoke#setInputVariable(cn.softTank.BpelModel.Variable
	 * )
	 */
	@Override
	public void setInputVariable(Variable value) {
		inputVariable = value;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.softTank.BpelModel.Invoke#setOutputVariable(cn.softTank.BpelModel.
	 * Variable)
	 */
	@Override
	public void setOutputVariable(Variable value) {
		outputVariable = value;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * cn.softTank.BpelModel.Invoke#setToParts(cn.softTank.BpelModel.ToParts)
	 */
	@Override
	public void setToParts(ToParts value) {
		toParts = value;
	}

	@Override
	public Element toElement() {
		node = super.toElement();
		node.setName("invoke");
		if (inputVariable != null)
			node.addAttribute("inputVariable", inputVariable.getName());
		if (outputVariable != null)
			node.addAttribute("outputVariable", outputVariable.getName());
		if (toParts != null)
			node.add(toParts.toElement());
		if (fromParts != null)
			node.add(fromParts.toElement());
		return node;
	}
}
